<div class="alert-title">登录IP绑定</div>

<table class="user-info">
    <tr>
        <td class="title">用户名</td>
        <td class="field">
            <input type="text" class="am-form-field ui_uid" value="" placeholder="" disabled>
        </td>
        <td class="copy"></td>
    </tr>

    <tr>
        <td class="title">白名单</td>
        <td class="field">
            <input type="text" class="am-form-field ui_ips" value="" placeholder="多个ip请用,分割">
        </td>
        <td class="copy"></td>
    </tr>
</table>

<div class="button_line">
    <button class="btn-save admin_button">保存</button>
    <button class="close admin_button">关闭</button>
</div>
<style type="text/css">
    .user-info .title {
        width: 110px !important;
    }
</style>

<script>
    // 填充用户信息
    var u = context.center.user;
    $(".ui_uid").val(u.mobile);
    $(".ui_ips").val(u.ips || '');

    $(".button_line .btn-save").click(function() {
        var ips = $(".ui_ips").val().trim();
        startLoading();
        CMD.user_ips(u.id, ips, function() {
            stopLoading();
            $("#modify_admin_ips").remove();
            _f();
        });
    });

    $(".button_line .close").click(function() {
        $("#modify_admin_ips").remove();
    });
</script>